package com.cjyd.hrjb.utils;

/**
 * Created fei wo by 2020/4/5
 */
public enum ResultCode {
    SUCCESS(0,"成功"),
    SYSTEM_ERROR(1,"系统错误"),
    ENUM_PARSE_EXCEPTION(2,"枚举转换错误"),
    PARAMS_INVALID(3,"参数错误"),
    CLIENT_ERROR(4,"客户端错误"),
    UPDATE_ACCESS_TOKEN_FAIL(5,"更新TOKEN失败"),
    UNION_ID_OR_PHONE_EMPTY(6,"微信UnionId或手机号码必须有一个"),
    USER_PHONE_EXISTS(7,"手机号码已注册"),
    USER_REGISTER_FAIL(8,"注册失败"),
    USER_NOT_EXISTS(9,"用户不存在"),
    SYNC_USER_INFO_FAIL(10,"同步用户信息失败"),
    RECOMMEND_USER_NOT_EXISTS(11,"推荐人不存在"),
    ADMIN_ALREADY_EXISTS(12,"管理员已存在"),
    ADD_ADMIN_FAIL(13,"添加管理员失败"),
    ADMIN_NOT_EXISTS(14,"管理员不存在"),
    UPDATE_ADMIN_FAIL(15,"更新管理员信息失败"),
    DEL_ADMIN_FAIL(16,"删除管理员失败"),
    LOGIN_ADMIN_FAIL(17,"账号或密码错误"),

    VERIFY_CODE_EXPIRED(18,"验证码已经过期"),
    VERIFY_CODE_FAIL(19,"验证码不正确"),

    ADMIN_STATE_DISABLE(20,"当前用户已被禁用")
    ;

    private Integer code;
    private String msg;

    ResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ResultCode setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public Integer getCode() {
        return code;
    }
}
